﻿@using PagedList
@using PagedList.Mvc;
@model PagedList.IPagedList<IankerProj.Models.Danhmuc>
@{
    ViewBag.Title = "Danhmuc";
    Layout = "~/Views/Shared/_Adminlayout.cshtml";
}

<script src="~/Scripts/jquery-1.9.1.js"></script>
<script>
    $(document).ready(function () {
        $('tr').click(function () {
            var id = jQuery(this).attr("id");
            $.get('/Admin/Suadm', { 'term': id }, function (data) {
                $('#content').html(data);
            });
            return false;
        });
    });
</script>
<div class="row">
    <div class="col-lg-6">
        <h1>Thông Sản phẩm</h1>
        <div class="table-responsive">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>Mã Danh mục</th>
                        <th>Tên Danh mục</th>
                        <th>id cha</th>
                    </tr>
                </thead>
                <tbody>

                    @foreach (var c in Model)
                    {
                        <tr id="@c.id">
                            <td>@c.id</td>

                            <td>@c.ten</td>
                            <td>@c.idcha</td>
                        </tr>
                    }
                </tbody>
            </table>
            @Html.PagedListPager(Model, page => Url.Action("Danhmuc", new { page }), PagedListRenderOptions.MinimalWithPageCountText)
        </div>
    </div>
    <div class="col-lg-6" id="content">

    </div>
</div>


